﻿#include "GaoDeMapProvider.h"

// https://blog.csdn.net/qq_16504163/article/details/113985988

/**************************************
 *
 * class GaoDeMapProvider
 *
 **************************************/
GaoDeMapProvider::GaoDeMapProvider(const QString &format, const quint32 averageSize, const QGeoMapType::MapStyle mapType, QObject *parent)
    : MapProvider(QStringLiteral("https://www.amap.com/"), format, averageSize, mapType, parent)
{
}

/**************************************
 *
 * class GaoDeSatelliteMapProvider
 *
 **************************************/
GaoDeSatelliteMapProvider::GaoDeSatelliteMapProvider(QObject *parent)
    : GaoDeMapProvider("png", AVERAGE_TILE_SIZE, QGeoMapType::SatelliteMapDay, parent)
{
}

QString GaoDeSatelliteMapProvider::_getURL(const int x, const int y, const int zoom, QNetworkAccessManager *networkManager)
{
    Q_UNUSED(networkManager)
    return amapSatellite.arg(x).arg(y).arg(zoom);
    //return QStringLiteral("http://webst01.is.autonavi.com/appmaptile?style=8&x=%1&y=%2&z=%3&ltype=7").arg(x).arg(y).arg(zoom);
}

/**************************************
 *
 * class GaoDeStreetMapProvider
 *
 **************************************/
GaoDeStreetMapProvider::GaoDeStreetMapProvider(QObject *parent)
    : GaoDeMapProvider("png", AVERAGE_TILE_SIZE, QGeoMapType::StreetMap, parent)
{
}

QString GaoDeStreetMapProvider::_getURL(const int x, const int y, const int zoom, QNetworkAccessManager *networkManager)
{
    Q_UNUSED(networkManager)
    return amapStreet.arg(x).arg(y).arg(zoom);
}
